package com.corpgovernment.common.logging.bo;

import java.util.HashMap;
import java.util.Map;

import lombok.Data;

/**
 *  @author: pwang27
 *  @Date: 2023/11/8 14:28
 *  @Description: 日志的tag内容
 */
@Data
public class LogTags {
    private String corpId;
    private Long orderId;
    private String uid;
    private String supplierOrderId;
    private String supplierCode;
    private Map<String, String> parameters = new HashMap<>();

    public LogTags add(String key, String value) {
        if (key != null) {
            key = key.toLowerCase();
        }
        parameters.put(key, value);
        return this;
    }

    public LogTags remove(String key) {
        if (key != null) {
            key = key.toLowerCase();
        }
        parameters.remove(key);
        return this;
    }

    public static LogTags build(String key, String value) {
        LogTags tags = new LogTags();
        tags.parameters.put(key, value);
        return tags;
    }
}
